package com.moxiao.yfjh.module.blind.common;

import org.apache.commons.lang3.StringUtils;

import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

/**
 * @version 1.0
 * @Author zhk
 * @Date 2024/1/25 13:41
 **/
public class MemberUserEnumUtil {


    public static List<String> matchAge(String dictDataLabel){
        List<String> matchAgeList = new ArrayList<>();
        if (StringUtils.isNotEmpty(dictDataLabel)){
            if (Objects.equals(dictDataLabel,"不限")){
                return matchAgeList;
            }
            if (dictDataLabel.contains("岁以下") ){
                String substring = dictDataLabel.substring(0, 2);
                matchAgeList.add("0");
                matchAgeList.add(substring);
                return matchAgeList;
            }
            if (dictDataLabel.contains("岁以上")){
                String substring = dictDataLabel.substring(0, 2);
                matchAgeList.add(substring);
                matchAgeList.add("100");
            }

            if (dictDataLabel.contains("~")){
                String ageMix = dictDataLabel.substring(0, 2);
                matchAgeList.add(ageMix);
                String ageMax = dictDataLabel.substring(3, 5);
                matchAgeList.add(ageMax);
            }
        }
       return matchAgeList;
    }

    public static List<String> matchHeight(String dictDataLabel){
        List<String> matchHeightList = new ArrayList<>();
        if (StringUtils.isNotEmpty(dictDataLabel)){
            if (Objects.equals(dictDataLabel,"不限")){
                return matchHeightList;
            }
            if (dictDataLabel.contains("cm以下")){
                String substring = dictDataLabel.substring(0, 3);
                matchHeightList.add("0");
                matchHeightList.add(substring);
                return matchHeightList;
            }
            if (dictDataLabel.contains("cm以上")){
                String substring = dictDataLabel.substring(0, 3);
                matchHeightList.add(substring);
                matchHeightList.add("300");
            }
            if (dictDataLabel.contains("~")){
                String heightMix = dictDataLabel.substring(0, 3);
                matchHeightList.add(heightMix);
                String heightMax = dictDataLabel.substring(4, 7);
                matchHeightList.add(heightMax);
            }
        }
        return matchHeightList;
    }






}
